﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SuperSocket.SocketBase;
using SuperSocket.SocketBase.Config;
using SuperSocket.SocketBase.Protocol;

namespace VswService_V7.Sok
{
    public class VswTcpServer : AppServer<VswSession>
    {
        //Use custom command line protocol: COMMAND; P1; P2; P3 + ##; P1 is fixed as an identifier
        public VswTcpServer()
            : base(new TerminatorReceiveFilterFactory("##", Encoding.UTF8, new BasicRequestInfoParser(";", ";")))  //Create separators and terminators
                                                                                                                   //:base(new CommandLineReceiveFilterFactory(Encoding.Default,new BasicRequestInfoParser(":",",")))   //Just create a separator
        {

        }

        //The following methods can be rewritten. The rewriting here is meaningless, because all use base.xxx ()
        //protected override bool Setup(IRootConfig rootConfig, IServerConfig config)
        //{
        //    return base.Setup(rootConfig, config);
        //}

        protected override void OnStarted()
        {
            base.OnStarted();
        }

        protected override void OnStopped()
        {
            base.OnStopped();
        }
    }
}
